{% extends "base.html" %}

{% block edit_form %}
<div class="form">

{% ifequal action 'new' %}
    <h3>Create new task</h3>
    <form method="POST" action="/tasktracker/task/new/">
{%else%}
    <h3>Edit task</h3>
    <form method="POST" action="/tasktracker/task/{{task.task_id}}/edit/">
{% endifequal %}

    <input type="hidden" name="task_id" value="{{task.task_id}}">
    {% for field in task %}
        <div class="fieldWrapper">
            <div class="field-error">{{ field.errors }}</div>
            <div class="field-label">{{ field.label_tag }}</div>
            <div class="field-value">{{ field }}</div>
        </div>
    {% endfor %}
    <input type="submit" value="Apply" />
</form>
</div>
{% endblock %}
